<template>
    <div>
        <div class="input-container">
      <input placeholder="请输入标题" class="input-field" type="text" />
      <label for="input-field" class="input-label">新闻标题</label>
      <span class="input-highlight"></span>
    </div>
    </div>
</template>

<script setup lang="ts">

</script>

<style scoped>
/* 新闻标题样式 */
/* Input container */
.input-container {
  position: relative;
  margin: 1.25rem;
}

/* Input field */
.input-field {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #ccc;
  outline: none;
  background-color: transparent;
}

/* Input label */
.input-label {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 16px;
  color: rgba(204, 204, 204, 0);
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Input highlight */
.input-highlight {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background-color: #007bff;
  transition: all 0.3s ease;
}

/* Input field:focus styles */
.input-field:focus + .input-label {
  top: -20px;
  font-size: 12px;
  color: #007bff;
}

.input-field:focus + .input-label + .input-highlight {
  width: 100%;
}
</style>